﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TransFormer.BLL;

namespace TransFormer.Web
{
    public partial class MasterPage : System.Web.UI.MasterPage
    {
        private BLL.Clients _bllClients = new BLL.Clients();
        public string _tabtitle = "";
        public string TabTitle
        {
            get
            {
                return _tabtitle;
            }
            set
            {
                _tabtitle = value;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void SearchClick(object sender, EventArgs e)
        {
            Response.Redirect("productSearch.aspx?searchInput=" + searchInput.Text);
        }

        protected void LiuYan(object sender, EventArgs e)
        {
            var rateText = Request.Form["rateText"];
            var emailText = Request.Form["emailText"];
            if (string.IsNullOrEmpty(emailText) || string.IsNullOrEmpty(rateText)) return;
            _bllClients.Add(new Model.Clients()
                                {
                                    Date = DateTime.Now,
                                    Email = emailText,
                                    IsReaded = false,
                                    Message = rateText
                                });
        }
    }
}
